Method 2: Ansatz
In the previous section, we derived the differential equation that describes the motion of a mass-spring system. This differential equation is a second-order ordinary differential equation (ODE) that can be written as:
In this section, we will explore the second method to solve this differential equation, which uses the ansatz method.
Table of Contents
The Ansatz Method
"Ansatz" is a German word that means "approach" or "attempt". In mathematics, the ansatz method is a method of solving differential equations by guessing a solution and then verifying that it satisfies the differential equation.
The ansatz method is particularly useful for solving linear differential equations, such as the one we have here.
In order to make an educated guess for the solution of the differential equation, we can use both the form of the differential equation and our knowledge of the system:
- In a spring-mass system, or any other system that exhibits simple harmonic motion, we know that the system oscillates back and forth around the equilibrium position.
- We also know that the second derivative of the position with respect to time is proportional to the position itself, with a negative sign.
Based on this knowledge, we can guess that the solution to the differential equation can take two forms:
- A sinusoidal function of time, such as
or . - An exponential function of time, such as
.
It's not a coincidence that both of these functions are solutions to the differential equation. In fact, they fundamentally describe the same motion, just in different ways, which deserves a deeper discussion.
Consider the function
Now if we put an imaginary term in the exponent, we get
Now recall that the trigonometric functions
We will try both of these forms and see that they are indeed solutions to the differential equation. Before that, we need to remind ourselves of the initial conditions of the system:
- The position of the object at
is . - The velocity of the object at
is .
Trying the Sinusoidal Function
Let's first try the sinusoidal function
The acceleration is given by:
So this indeed holds true for the differential equation.
We can also try the cosine function
This corresponds to the fact that the sine and cosine functions both describe the same motion, just with different phase offsets.
Trying the Exponential Function
Now let's try the exponential function
The acceleration is given by:
Now we can substitute this into the differential equation:
Hence
Plugging this back into the exponential function, we get:
Since this is complex-valued, we can take the real part of this function to get a real-valued solution:
General Solution
From the above analysis, we see that the general solution is either a sine function or a cosine function:
Which one is correct? It turns out, both are correct, but the general solution is more than just one of these functions.
Consider two solutions
Similarly, multiplying a solution by a constant also gives a solution:
This means that if we have the sine and cosine solutions, we can freely add and multiply them to get another solution. This is known as a linear combination of the solutions:
This is the most general solution to the differential equation; any other solution can be written in this form.